<?php
/**
 * Created by Zhy
 * User: Zhy
 * Date: 2018/8/2
 * Time: 16:54
 */

namespace app\api\model;


use think\Model;

class Activity extends Model
{
    /**
     * 获取活动类型的名称
     * @param $activity_id 活动类型ID
     * @return mixed
     */
    public function activityTypeName($activity_id){
        $typeName = $this->where('id', $activity_id)->value('activity_name');
        return $typeName;
    }
    
    /**
     * 获取活动分类列表
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function getActivityList(){
        $activityLists = $this->field('id, activity_name')->select();
        return $activityLists;
    }
}